<?php
function smarty_function_ip($params, &$smarty){
	return $params['to'] == 'long' ? ip2long($params['value']) : long2ip($params['value']);
}